using System;
using System.Diagnostics.Contracts;
using Raven.Client;

namespace OpenWaves.ActivityFeed.RavenDB
{
    [ContractClass(typeof(DocumentSessionProviderContract))]
    public interface IDocumentSessionProvider
    {
        IDocumentSession DocumentSession { get; }
    }

    [ContractClassFor(typeof(IDocumentSessionProvider))]
    internal class DocumentSessionProviderContract : IDocumentSessionProvider
    {
        public IDocumentSession DocumentSession
        {
            get 
            { 
                Contract.Ensures(Contract.Result<IDocumentSession>() != null); 
                throw new NotImplementedException();
            }
        }
    }
}